package InnerClass;

/**
 * Created by Administrator on 2022/8/19.
 */

public class PartClass {
    public int data1 = 1;
    private int data2 = 2;
    public static int data3 = 3;

    /**
     * 局部内部类：定义在方法体内部
     *不能被public、static等访问限定符修饰
     * 只能在该方法体内部使用，其他位置都不能用
     */
    public void fun() {
        class Part {
            public int data3 = 3;
            public void print() {
                System.out.println(data1);
                System.out.println(data2);
                System.out.println(PartClass.this.data3);
                System.out.println(data3);
            }
        }
        Part part = new Part();
        part.print();
    }
}
class Test3 {
    public static void main(String[] args) {
        PartClass partClass = new PartClass();
        partClass.fun();

    }
}